 <#import "../macro/macro.ftl" as m>
 <@m.headContent />
 <@m.script type="css" href="css/setting.css" version="1.2"/>
 <script type="text/javascript">
	 	$(function() {
	 		<#if mo??>
	 			<#list mo?keys as key>
	 				createGridById("${key}_grid","${sys_path}/dynamic/column?id=${key}");
				</#list>
			</#if>
  	 	});
  	 	function settingchange(n){
  	 		var colum=$(n).attr("name");
  	 		var val=$(n).val();
  	 		var dtype=$(n).attr("dtype");
  	 		var data={"column": colum, "value": val, "dtype": dtype};
  	 		var iscommit=true;
  	 		if(dtype=="int"){
  	 			if(!isNumber(val)){
  	 				showMsg("不是有效的数字");
  	 				$(n).val("");
  	 				iscommit=false;
  	 			}
  	 		}
  	 		if(iscommit){
				commitAjax("${sys_path}/base/setting/do",data);
  	 		}
		}
  </script>
  <script id="tpl-setting" type="text/html">
  	<table  class="adr-table">
  		<thead>
  			<tr>
  				<th><span>列值</span></th>
  				<th><span>列名</span></th>
  				<th><span>宽度</span></th>
  				<th><span>表头居中</span></th>
  				<th><span>内容居中</span></th>
  				<th><span>是否排序</span></th>
  				<th><span>格式化</span></th>
  				<th><span>显示位置</span></th>
  				<th><span>是否显示</span></th>
  			</tr>
  		</thead>
  		<tbody>
  			{{if size}}
  				{{each list as value}}
  					<tr>
  						<td>{{value.field}}</td>
  						<td>{{value.text}}</td>
  						<td>{{value.width}}</td>
  						<td>{{value.halign}}</td>
  						<td>{{value.align}}</td>
  						<td>{{value.sortable}}</td>
  						<td>{{value.formatter}}</td>
  						<td>{{value.sort}}</td>
  						<td>
  							<div class='switch_div'>
								<input type="checkbox" id='checkbox-{{value.id}}' class='switchbtn' style="width:100px;"/>
								<label for="checkbox-{{value.id}}"></label>
							<div>
  						</td>
  					</tr>
  				 {{/each}}
  			{{else}}
  				<tr><td colspan="9">暂无数据</td></tr>
  			{{/if}}
  		</tbody>
  	</table>
  </script>
 <#assign inputstyle = "width:320px;height:31px;">
<div  class="easyui-layout" data-options="fit:true">
	<div data-options="region:'west',split:true,iconCls:'icon-cog'" title="基本设置" style="width:400px;padding-left:10px;">
		<div class="table-add-div">
	        <form id="settingFormId" method="post">
	        	<input type="hidden" value="${(res.id)!''}" id="id" name="id">
	        	<fieldset class="fieldset">
			    	<legend >主题配置</legend>
			    	<@m.settingInput lable="系统名称" name="headMainTitle" value="${(res.headMainTitle)!''}" change="settingchange(this)"/>
			    	<@m.settingInput lable="系统副标题" name="headSubTitle" value="${(res.headSubTitle)!''}" change="settingchange(this)"/>
			    	<@m.settingInput lable="系统LOGO" name="headLogo" value="${(res.headLogo)!''}" change="settingchange(this)"/>
			    	<@m.settingInput lable="头部高度" name="headHeight" value="${(res.headHeight)!''}" change="settingchange(this)" dtype="int"/>
				</fieldset>
	        	
	        	<fieldset class="fieldset">
			    	<legend >版权信息</legend>
			    	<@m.settingInput lable="版权信息" name="footCopyright" value="${(res.footCopyright)!''}" change="settingchange(this)"/>
			    	<@m.settingInput lable="版权栏高度" name="footHeight" value="${(res.footHeight)!''}" change="settingchange(this)" dtype="int"/>
			    </fieldset>	
			    
			    <fieldset class="fieldset">
			    	<legend >导航信息</legend>
			    	<@m.settingInput lable="导航标题" name="navigatTitle" value="${(res.navigatTitle)!''}" change="settingchange(this)"/>
			    	<@m.settingInput lable="导航图标" name="navigatIcons" value="${(res.navigatIcons)!''}" change="settingchange(this)"/>
			    	<@m.settingInput lable="导航宽度" name="navigatWidth" value="${(res.navigatWidth)!''}" change="settingchange(this)" dtype="int"/>
			    </fieldset>	
	        	
	        	 <fieldset class="fieldset">
			    	<legend >信息栏</legend>
			    	<@m.settingInput lable="信息栏标题" name="InformationBarTitle" value="${(res.InformationBarTitle)!''}" change="settingchange(this)"/>
			    	<@m.settingInput lable="信息栏图标" name="InformationBarIcons" value="${(res.InformationBarIcons)!''}" change="settingchange(this)"/>
			    	<@m.settingInput lable="信息栏宽度" name="InformationBarWidth" value="${(res.InformationBarWidth)!''}" change="settingchange(this)" dtype="int"/>
			    </fieldset>	
			    
			    <fieldset class="fieldset">
			    	<legend >主面板</legend>
			    	<@m.settingInput lable="主面板标题" name="mainPanelTitle" value="${(res.mainPanelTitle)!''}" change="settingchange(this)"/>
			    	<@m.settingInput lable="主面板图标" name="mainPanelIcons" value="${(res.mainPanelIcons)!''}" change="settingchange(this)"/>
			    </fieldset>
	        	
	        
	        	<fieldset class="fieldset">
			    	<legend >首页</legend>
			    	<@m.settingInput lable="首页TAB标题" name="welcomeTitle" value="${(res.welcomeTitle)!''}" change="settingchange(this)"/>
			    	<@m.settingInput lable="首页TAB图标" name="welcomeIcons" value="${(res.welcomeIcons)!''}" change="settingchange(this)"/>
			    </fieldset>
	        </form>
        </div>
	</div>
	<div data-options="region:'center',iconCls:'icon-cog'" title="动态列设置" style="padding:10px;">
 		<#if mo??>
 			<#list mo?keys as key>
				<fieldset class="fieldset">
			    	<legend >${mo[key]}</legend>
			    	<div id="${key}_grid"></div>
			    	<#--<table id="${key}_grid" class="adr-table"></table>-->
				</fieldset>
			</#list>
		</#if>
	</div>
</div>